package tds.model25;
/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Client
 * @Description 请假审批大致模拟责任链模式
 * @author tds
 * @Date 2020/2/7 20:09
 * @version 1.0.0
 */
public class Client {
    public static void main(String[] args) {
        // 创建主任、经理、总经理对象
        Leader director = new Director("张三");
        Leader manager = new Manager("李四");
        Leader generalManager = new GeneralManager("王五");

        // 设置链关系
        director.setNextLeader(manager);
        director.setNextLeader(generalManager);

        // 创建请假请求
        LeaveRequest request = new LeaveRequest("请假请求", "肺炎", 31);

        // 从链开始执行请求
        director.handleRequest(request);

    }
}
